<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
	<title>湖南省自来水公司营销管理信息系统</title> 
	
	<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title" />	
	<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title" />	
	
	<link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title" />
	
	<link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">

</head> 
 
<body> 

<div id="wrapper">
	
		
	
	<div id="bool"><script>window.onload=function (){  $("#bool").load("../ming.html");}</script></div>

	

	
	<div id="content" class="xgrid">
	 		
		<div class="x12">
		
			<div id="facebox_delete" style="display: none">
				<div style="height:80px;text-align:center;padding-top:50px;">
					确认删除吗？
				</div>
				
				<div class="dialogbutton center">
					<a class="btn" href="javascript:closeDialog();" style="width:60px;">是</a>  
					<a class="btn btn-grey" href="javascript:closeDialog();" style="width:60px;">否</a>
				</div>
			</div>
			
			<h2>菜单权限</h2>
			
			
		<p>
			<div style="float:left;">
				<button class="btn-icon btn-star" type="button" @click="duo()"><span></span>批量设置菜单权限</button>
			</div>

			
			<div style="float:right;">
				部门 
				<select id="type" class="medium" @change="query()">
                    <option selected="selected" value="">所有部门</option>
                    <option v-for="de in SyDepts" :value="de.deptName">{{de.deptName}}</option>
                </select>
			</div>
		</p>
			<table class="data display datatable">
				<thead>
					<tr>
						<th><input type="checkbox" onChange="$(':checkbox').attr('checked', this.checked)" /></th>
						<th>员工ID</th>
						<th>员工工号</th>
						<th>员工姓名</th>
						<th>所属部门</th>
						<th>备注</th>
						<th></th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="emp in Syemps" class="odd gradeX"  >
						<td><input type="checkbox" class="checl" :value="emp.id" /></td>
                        <td >{{emp.id}}</td>
                        <td >{{emp.empNo}}</td>
                        <td >{{emp.empNmae}}</td>
                        <td v-for="de in SyDepts" v-if="de.id==emp.deptID">{{de.deptName}}</td>
                        <td>{{emp.remark}}</td>
						<td class="center">
							<button class="btn-icon btn-small btn-blue btn-star" @click="update(emp.id)"><span></span>设置菜单权限</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div> <!-- .x12 -->
		
	</div> <!-- #content -->

	<div id="footer">		
		<div class="content_pad">			
			<p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>.   技术支持 <a href="#">职业教育</a>.</p>
		</div> <!-- .content_pad -->
	</div> <!-- #footer -->
	
</div> <!-- #wrapper -->

<script src="../js/jquery/jquery-1.5.2.min.js"></script>
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>
<script src="../js/vue.js"></script>
<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>
<script type="text/javascript">

    function  load() {
        $.getJSON("../Sydept/queryall",{},function(json){
            app.SyDepts=json;
        });
        $.getJSON("../Syemp/queryall",{},function(json){
            app.Syemps=json;
        });
    }
    var app = new Vue({
        el:"#wrapper",
        data:{
            SyDepts:'',
            Syemps:'',
            ids:[
                {id:'4'},
                {id:'5'}
            ]
        },
        methods:{
            update(id){
                localStorage.setItem("list",null);
                location="sys_menupower_set.html?id="+id;
            },
            duo(){
                var che = $(".checl");
                var json=new Array();
                $.each(che,function(){
                 if(this.checked==true){
                        json.push(this.value);
                 }
                });
                localStorage.setItem("list",JSON.stringify(json));
                location="sys_menupower_set.html";
            },
            query(){
                $("#lai").val($("#type").val());
                $("#lai").keyup();
            }
        },
        //监听事件
        watch:{
            Syemps:function(){
                this.$nextTick(function(){
                    $(document).ready ( function ()
                    {
                        Dashboard.init ();
                    });
                });
            }
        },
        created(){
            load();
        }
    });
</script>

</body> 
 
</html>